
import axios from '@/functions/request';
function getList(){
    return new Promise((resolve, reject)=>{
        axios.formPost( "/api/auth/sysrole/doGetList",{}).then(res=>{
            resolve(res)
        }).catch(e => {
            reject(e)
        });
    })
    
}
function addItem(params){
    return new Promise((resolve, reject)=>{
        axios.formPost( "/api/auth/sysrole/doSaveRole",{roleName:params.roleName}).then(res=>{
            resolve(res)
        }).catch(e => {
            reject(e)
        });
    })
    
}
function deleteItem(params){
    return new Promise((resolve, reject)=>{
        axios.formPost( "/api/auth/sysrole/doDelRole",{id:params.id}).then(res=>{
            resolve(res)
        }).catch(e => {
            reject(e)
        });
    })
    
}
function editItem(params){
    return new Promise((resolve, reject)=>{
        axios.formPost( "/api/auth/sysrole/doModRole",{roleName:params.roleName,id:params.id}).then(res=>{
            resolve(res)
        }).catch(e => {
            reject(e)
        });
    })

}
function showUser(params){
    return new Promise((resolve, reject)=>{
        axios.formPost( "/api/auth/sysrole/doGetListWithRoleId",{id:params.id}).then(res=>{
            resolve(res)
        }).catch(e => {
            reject(e)
        });
    })

}
export {
    getList,
    deleteItem,
    addItem,
    editItem,
    showUser
}